package com.baizhi.day01;


public class ObjectTest {
    public static void main(String[] args) {

        Dog dog = new Dog();
        //访问成员变量并初始化
        dog.name = "旺财";
        dog.age = 3;
        //调用成员方法
        dog.lookHome();

        System.out.println("--------------------");

        //创建学生对象
        Student s1 = new Student();
        //访问成员变量，并初始化
        s1.stuId = "001";
        s1.name = "张三";
        s1.age = 19;
        s1.genner = '男';
        s1.address = "北京海淀";
        //调用学生学习的方法
        s1.study();

        System.out.println("-------------------");

        Student s2 = new Student();
        //调用成员变量并初始化
        s2.stuId = "002";
        s2.name = "李四";
        s2.age = 20;
        s2.genner = '女';
        s2.address = "天津宝坻";
        //调用李四问好的方法
        s2.speakHi();

        System.out.println("------------------");

        Student s3 = new Student();
        //访问成员变量并初始化
        s3.stuId = "003";
        s3.name = "王五";
        s3.age = 17;
        s3.genner = '男';
        s3.address = "江苏南京";



        //创建手机对象
        Phone p1 = new Phone();
        //访问成员变量并初始化
        p1.brand = "华为";
        p1.price = 7800;

        Phone p2 = new Phone();
        //访问成员变量并初始化
        p2.brand = "苹果";
        p2.price = 9200;

    }
}
